package com.sykj.manage.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sykj.manage.service.BisBeautyRecordService;
import com.sykj.manage.model.BisBeautyRecord;
import com.sykj.manage.model.BisBusinessOrder;
import com.sykj.util.ManageBody;
import com.sykj.util.PageUtil;

@Controller
@RequestMapping("/bbr")
public class BisBeautyRecordController {
   
	@Autowired
	BisBeautyRecordService bisBeautyRecordService;
	
	@RequestMapping("/list")
	@ResponseBody
	public ManageBody getBeauty(BisBeautyRecord bisBeautyRecord,Integer offset,Integer pageSize){
		PageHelper.startPage(offset==null?1:PageUtil.getPageNum(offset, pageSize),pageSize==null?10:pageSize,true);
		List<BisBeautyRecord> getBeauty = bisBeautyRecordService.getBeauty(bisBeautyRecord);
		PageInfo<BisBeautyRecord>pageInfo = new PageInfo<BisBeautyRecord>(getBeauty);
		System.out.println("======================="+bisBeautyRecord);
		return ManageBody.getData((int)pageInfo.getTotal(),pageInfo.getList(),"");
		
	}
}
